package com.github.chirspan.xaas.cfg.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.chirspan.xaas.cfg.dao.CfgAppDao;
import com.github.chirspan.xaas.cfg.model.CfgApp;
import com.github.chirspan.xaas.cfg.service.ICfgAppService;
import com.github.chirspan.xaas.mybatis.service.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author: chenpan
 * @Date: 2021-04-07 18:24:53
 * @Description: 应用配置 接口实现
 */
@Service
public class CfgAppServiceImpl extends BaseServiceImpl<CfgAppDao, CfgApp> implements ICfgAppService {

    @Autowired
    private CfgAppDao appDao;

    @Override
    public CfgApp getAppByCode(String code) {
        QueryWrapper<CfgApp> wrapper = new QueryWrapper<>();
        wrapper.lambda().eq(CfgApp::getAppCode, code);
        return appDao.selectOne(wrapper);
    }
}